/** 
 * @properties={typeid:24,uuid:"568ED88B-2969-44C6-B314-D6E5EC72C056"}
 * @AllowToRunInFind
 */
function buscar_pendientes() 
{	
	if (globals.gProveedorDesde)
	{
		var query 	= 'SELECT ctacte_pr_id FROM ctacte_pr "cc" WHERE proveedor_id = '+ globals.gProveedorDesde + ' AND importe = saldo'
	
	}
	else
	{
		var query 	= 'SELECT ctacte_pr_id FROM ctacte_pr "cc" WHERE importe = saldo'
	}
	var ds		= databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()),query,null,-1);
	controller.loadRecords(ds);
	var found = ds.getMaxRowIndex();
	if (found == 0)
	{
		globals.DIALOGS.showWarningDialog('Aviso','No hay facturas para modificar','OK');
		return;
	}
}

/**
 *
 * @properties={typeid:24,uuid:"4B7FC969-C2D9-4E41-A8E2-E59490D59711"}
 */
function Iniciar()
{
	globals.gProveedorDesde = null;
	var query 	= 'SELECT ctacte_pr_id FROM ctacte_pr "cc" WHERE importe = saldo'
	var ds		= databaseManager.getDataSetByQuery(databaseManager.getDataSourceServerName(controller.getDataSource()),query,null,-1);
	controller.loadRecords(ds);
	var found = ds.getMaxRowIndex();
	if (found == 0)
	{
		globals.DIALOGS.showWarningDialog('Aviso','No hay facturas para modificar','OK');
	}
	return true
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"D0FECADF-AE0D-4436-AA0A-397654578976"}
 */
function modificar(event) {
	globals.formEnVentana('ctacte_pr_modif_2','CTACTE_MODIF','Modificación de Movimiento')
}
